package model.dto.user;

import java.util.ArrayList;
import java.util.Iterator;

import db.DAOFactory;

import model.Role;

/**
 * 
 * Description: 用于输出权限级别列表的DTO类<br/>
 * 其中list属性中Role对象没有operations属性
 *  
 * @since  2009/3/3
 * @author ashen
 * 
 */
public class RoleList {
	private ArrayList<model.dto.user.Role> list;
	
	public RoleList(ArrayList<model.dto.user.Role> list) {
		super();
		this.list = list;
	}

	public RoleList() {
		this.list=new ArrayList<model.dto.user.Role>();
		transRoleList(DAOFactory.getRoleDAO().findAll());
	}

	public ArrayList<model.dto.user.Role> getList() {
		return list;
	}

	public void setList(ArrayList<model.dto.user.Role> list) {
		this.list = list;
	}
	
	public void transRoleList(ArrayList<Role> list){
		for(Iterator i=list.iterator();i.hasNext();)
			this.list.add(new model.dto.user.Role((model.Role)i.next()));	
	}
	
	
}
